USE HierarchyIdDemo
GO

-- clear buffers so query performs as
-- from cold start
DBCC dropcleanbuffers

-- run non-hierarchyId charts
DECLARE @i INT
SET @i = 0

WHILE (@i < 10)
BEGIN

  EXEC SelfJoin.ShowDepartmentChart 1
  EXEC SelfJoin.ShowDepartmentChart 2
  EXEC SelfJoin.ShowDepartmentChart 3
  EXEC SelfJoin.ShowDepartmentChart 4
  EXEC SelfJoin.ShowDepartmentChart 5
  EXEC SelfJoin.ShowDepartmentChart 6
  EXEC SelfJoin.ShowDepartmentChart 7
  EXEC SelfJoin.ShowDepartmentChart 8
  EXEC SelfJoin.ShowDepartmentChart 9
  EXEC SelfJoin.ShowDepartmentChart 10
  EXEC SelfJoin.ShowDepartmentChart 11
  EXEC SelfJoin.ShowDepartmentChart 12
  EXEC SelfJoin.ShowDepartmentChart 13
  EXEC SelfJoin.ShowDepartmentChart 14
  EXEC SelfJoin.ShowDepartmentChart 15
  
  SET @i = @i + 1

END
GO

-- clear buffers so query performs as
-- from cold start
DBCC dropcleanbuffers

-- run hierarchyId charts
DECLARE @i INT
SET @i = 0

WHILE (@i < 10)
BEGIN

  EXEC HierarchyId.ShowDepartmentChart 1
  EXEC HierarchyId.ShowDepartmentChart 2
  EXEC HierarchyId.ShowDepartmentChart 3
  EXEC HierarchyId.ShowDepartmentChart 4
  EXEC HierarchyId.ShowDepartmentChart 5
  EXEC HierarchyId.ShowDepartmentChart 6
  EXEC HierarchyId.ShowDepartmentChart 7
  EXEC HierarchyId.ShowDepartmentChart 8
  EXEC HierarchyId.ShowDepartmentChart 9
  EXEC HierarchyId.ShowDepartmentChart 10
  EXEC HierarchyId.ShowDepartmentChart 11
  EXEC HierarchyId.ShowDepartmentChart 12
  EXEC HierarchyId.ShowDepartmentChart 13
  EXEC HierarchyId.ShowDepartmentChart 14
  EXEC HierarchyId.ShowDepartmentChart 15
  
    SET @i = @i + 1

END
